package cn.iocoder.yudao.module.im.enums;

import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * IM消息的类型枚举
 *
 * @author HUIHUI
 */
@AllArgsConstructor
@Getter
public enum ImMessageContentTypeEnum implements IntArrayValuable {

    TEXT(1, "文本消息"),
    MAP(2, "地图消息"),
    VOICE(3, "语音消息"),
    IMAGE(4, "图片消息"),
    EMOJI(5, "表情包"),

    // ========== 商城特殊消息 ==========
    PRODUCT(10, "商品消息"),
    ORDER(11, "订单消息");

    private static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ImMessageContentTypeEnum::getType).toArray();

    /**
     * 类型
     */
    private final Integer type;

    /**
     * 名称
     */
    private final String name;

    @Override
    public int[] array() {
        return ARRAYS;
    }

}
